#include <iostream>

using namespace std;

/* 无参构造想调用有参构造必须使用初始化列表*/
class Student
{
public:
    Student()
    {

    }
    Student(int score) : m_score(score)
    {
        cout<<"Student"<<endl;
    }

    long m_score;
private:
    
};

class Worker
{
public:
    Worker()
    {
        
    }
    Worker(int sarary) : m_sarary(sarary)
    {
        cout<<"Worker"<<endl;
    }
public:
    long m_sarary;
};


/* 多继承*/
class Undergraduate : public Student,public Worker
{
public:
    /* */
    Undergraduate(int score, int sarary, int gerade)
    {
        m_score = score;
        m_sarary = sarary;
        m_gerade = gerade;
        cout<<"Undergraduate"<<endl;
    }

    ~Undergraduate()
    {
        cout<<"~Undergraduate"<<endl;
    }

    void play()
    {
        cout<<"Undergraduate::dlay"<<endl;
    }
    void printInfo()
    {
        cout<< m_score << m_sarary << m_gerade <<endl;
    }
public:
    long m_gerade;
};



int main()
{
    Undergraduate ug(90, 8000, 10);
    int length = sizeof(ug);
    cout<<"length:"<<length<<endl;
    ug.printInfo();
    return 0;
}